//
//  CTMediator+ControllerAction.m
//  atXiaoGeBClient
//
//  Created by Linyu Niu on 12/04/2018.
//  Copyright © 2018 Linyu Niu. All rights reserved.
//

#import "CTMediator+ControllerAction.h"


NSString * const  kCTMediatorControllerTarget                                             = @"Controller";
NSString * const  kCTMediatorLoginAction                                                  = @"loginViewController";
NSString * const  kCTMediatorRegisterAction                                               = @"registerViewController";
NSString * const  kCTMediatorForgetPwdAction                                              = @"forgetPasswordViewController";
NSString * const  kCTMediatorWrapNavControllerAction                                      = @"wrapNavController";
NSString * const  kCTMediatorCompleteRegisterControllerAction                             = @"completeRegisterController";
NSString * const  kCTMediatorMainControllerAction                                         = @"mainController";
NSString * const  kCTMediatorWaitForFetchControllerAction                                 = @"waitForFetchController";
NSString * const  kCTMediatorConfirmFetchControllerAction                                 = @"confirmFetchController";
NSString * const  kCTMediatorWaitForPayControllerAction                                   = @"waitForPayController";
NSString * const  kCTMediatorPersonalControllerAction                                     = @"personalController";
NSString * const  kCTMediatorNoAuthControllerAction                                       = @"noAuthController";
NSString * const  kCTMediatorMyWalletControllerAction                                     = @"myWalletController";
NSString * const  kCTMediatorWalletDetailControllerAction                                 = @"walletDetailController";
NSString * const  kCTMediatorBindCardControllerAction                                     = @"bindCardController";
NSString * const  kCTMediatorCheckControllerAction                                        = @"checkController";
NSString * const  kCTMediatorMessageControllerAction                                      = @"messageController";
NSString * const  kCTMediatorAssignControllerAction                                       = @"assignController";
NSString * const  kCTMediatorPersonalCenterControllerAction                               = @"personalCenterController";







@implementation CTMediator(ControllerAction)

-(UIViewController *)loginViewController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorLoginAction params:nil shouldCacheTarget:NO];
}
-(UIViewController *)registerViewController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorRegisterAction params:nil shouldCacheTarget:NO];
}
-(UIViewController *)forgetPwdViewController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorForgetPwdAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)completeRegisterController:(NSString *)userId{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setNLYObjectForKey:userId forKey:@"userId"];
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorCompleteRegisterControllerAction params:dic shouldCacheTarget:NO];
}
-(UINavigationController *)wrapNavController:(UIViewController *)controller{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    if (controller) {
        [dic setNLYObjectForKey:controller forKey:@"controller"];
    }
    
    return (UINavigationController *)[self  performTarget:kCTMediatorControllerTarget action:kCTMediatorWrapNavControllerAction params:dic shouldCacheTarget:NO];
}

-(UIViewController *)mainController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorMainControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)waitForFetchController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorWaitForFetchControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)confirmFetchController{
    return [self performTarget:kCTMediatorControllerTarget action:kCTMediatorConfirmFetchControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)waitForPayController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorWaitForPayControllerAction params:nil shouldCacheTarget:NO];
}
-(UIViewController *)personalController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorPersonalControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)noAuthController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorNoAuthControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)myWalletController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorMyWalletControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)walletDetailController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorWalletDetailControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)bindCardController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorBindCardControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)checkController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorCheckControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)messageController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorMessageControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)assignController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorAssignControllerAction params:nil shouldCacheTarget:NO];
}

-(UIViewController *)personalCenterController{
    return (UIViewController *)[self performTarget:kCTMediatorControllerTarget action:kCTMediatorPersonalCenterControllerAction params:nil shouldCacheTarget:NO];
}
@end
